<%--
  Created by IntelliJ IDEA.
  User: LiuXiaoChuan
  Date: 2022/5/26
  Time: 19:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/ajaxForm.js"></script>
<script>
    layui.use(['table','util','jquery','layer','form'],function () {
        var table = layui.table,ut=layui.util,$=layui.jquery,layer=layui.layer,form=layui.form;

        //转载table
        var tabStaff= table.render({
            elem:'#tableData',//指定id选择器
            cols:[[
                {field:'enrollmentId',title:'编号'},
                {field:'studName',title:'学生姓名'},
                {field:'amount',title:'预定报名费'},
                // {field:'status',title:'状态'},
                {field:'negativeName',title:'招生老师'},
            ]],
            url:'${pageContext.request.contextPath}/et/ydtjlist',//请求路径

            method:'post',//请求方法
            page:true,//显示分页
            limits:[10,20,30,40,50],//切换的每页行数
            limit:10,//默认的每页行数
            loading:true,//数据加载效果样式

        });

        //监听form表单提交  模糊
            form.on('submit(search-btn)',function (d) {
                var studName=$("#studName").val();
                // alert(sid+""+ename);
                table.reload("tableData",{ //指定条件重载table
                    page:{curr:1},
                    where:{ //条件
                        studName:studName

                    }
                });
        });
        //监听form表单提交  模糊查询  查看全部按钮
        form.on('submit(shuax-btn)',function (d) {
            location.reload("titleEt");//重新加载父页面表格
        });

    });
</script>
</head>
<body>
<div>
<%--    <form class="layui-form">--%>

<%--        <div class="layui-inline">姓名</div>--%>
<%--        <div class="layui-inline">--%>
<%--            <input type="text" name="studName" id="studName" class="layui-input"/>--%>
<%--        </div>--%>
<%--        <a class="layui-btn" lay-filter="search-btn" lay-submit="" lay-size="sm">搜索</a>--%>
<%--        <a class="layui-btn" lay-filter="shuax-btn" lay-submit="" lay-size="sm">刷新</a>--%>
<%--    </form>--%>
</div>
<table class="layui-table" id="tableData" lay-filter="demo" ></table>
</body>
</html>
